package com.epic.dagger.tutorial;

import java.util.List;

abstract  class SingleArgsCommand implements Command {
    @Override
    public String key() {
        return "ok";
    }

    @Override
    public Result handleInput(List<String> input) {
        return input.size() == 1 ? handleArg(input.get(0)) : Result.invalid();
    }
    /** Handles the single argument to the command. */
    protected abstract Result handleArg(String args);
}
